<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  <title>用户信息</title>
  <style>
    table {
        border-collapse: collapse;
        text-align: center;
    }
    table td {
        border:1px solid black;
    }
    .search {
        
    }
  </style>
  <script>
  </script>
</head>
<body>
  <a href="UserServlet?action=add">添加</a>
  <table>
    <tr>
	  <td>账号</td>
      <td>姓名</td>
      <td>性别</td>
      <td>角色</td>
      <td>操作</td>
    </tr>
    <c:forEach var="user" items="${list}">
      <tr>
        <td>${user.account}</td>
        <td>${user.name}</td>
        <td>${user.sex}</td>
        <td>${user.role}</td>
        <td><a href="UserServlet?action=add&id=${user.id}">编辑</a><a href="UserServlet?action=deleteUser&id=${user.id}">删除</a></td>
      </tr>
    </c:forEach>
  </table>
  <c:if test="${page>1}">
    <a href="UserServlet?action=userList&page=${page-1}">上一页</a>
  </c:if>
  <c:if test="${page<pageNumber}">
    <a href="UserServlet?action=userList&page=${page+1}">下一页</a>
  </c:if>
  <a>第 ${page}/${pageNumber} 页</a>
</body>
</html>